import $axios from "./$axios.js"

export const deliveryAddress_add = async (consignee, consignee_tel, area, address) => {
  return await $axios({
    method: 'post',
    url: '/api/deliveryAddress/add',
    data: {
      consignee,
      consignee_tel,
      area,
      address
    }
  })
}

export const deliveryAddress_del = async (id) => {
  return await $axios({
    method: 'delete',
    url: '/api/deliveryAddress/del',
    params: {
      id
    }
  })
}

export const deliveryAddress_update = async (id, consignee, consignee_tel, area, address) => {
  return await $axios({
    method: 'put',
    url: '/api/deliveryAddress',
    data: {
      id,
      consignee,
      consignee_tel,
      area,
      address
    }
  })
}

export const deliveryAddress_all = async () => {
  return await $axios({
    url: '/api/deliveryAddress'
  })
}